//个人中心模块路由
export default [
    {
        path: '/center',
        name: 'center',
        component: () => import(/* webpackChunkName: 'center'*/ '@/views/center'),
        meta :{
            //不需要验证
            allow:true
        },
        beforeEnter: (to, from, next) => {
            if(to.meta.allow){
                next()
            }else{
                const tokenStr = window.sessionStorage.getItem('token')
                if (!tokenStr) return next('/login')
                next()
            }
          
        },
        children: [
        
            {
                path: 'userinfo',
                name: 'userinfo',
                component: () => import(/* webpackChunkName: 'userinfo'*/ '@/views/center/userinfo'),
            },
        ]

    },
    {
        path: '/login',
        name: 'login',
        component: () => import(/* webpackChunkName: 'login'*/ '@/views/center/login'),


    },
    {
        path: '/signin',
        name: 'signin',
        component: () => import(/* webpackChunkName: 'signin'*/ '@/views/center/signin')
    },
]